package com.avantis.common.repository;

import com.avantis.common.entity.Level;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @Description:    java类作用描述
* @Author:         kirago
* @CreateDate:     2019/2/16 2:58 PM
* @UpdateRemark:   修改内容
* @Version:        1.0
*/
@Repository
public interface LevelRepository extends JpaRepository<Level, Integer>, JpaSpecificationExecutor {

    @Modifying
    @Query("delete from Level l where l.id= :id")
    void deleteByUuid(@Param("id")String id);

    @Modifying
    @Query("select l from Level l where l.levelType= :levelType")
    List<Level> findAllByLevelType(@Param("levelType")Integer levelType);
}
